home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / performance.388 < prev    next >
Text File  |  1992-02-06  |  1KB  |  36 lines

  1. User paths performance postscript
  2.  
  3. Q: How much does the use of user paths improve drawing speed?
  4.  
  5. A: Here are some numbers which quantify for one particular situation the benefit of using user paths. Two interesting things from the numbers below are:
  6.  
  7. 1- size of the win
  8.  
  9. 2- user paths, like xyshow are a performance (if not convenience) win even when drawing just a few lines.
  10.  
  11. Table shows cumulative time(sec) taken to do 100 iterations of a loop which does an erase, draws a number of lines (vertical 150 pixels high), flushes the window and pings the window server. 4 Different cases were tested:
  12.  
  13. Case 1: Draw lines using PSlineto() and PSmoveto(). lockFocus and unLockFocus inside loop
  14.  
  15. Case 2: Same as Case 1 except lockFocus and unLockFocus taken out of loop
  16.  
  17. Case 3: Draw lines using DPSDoUserPath(), arrays malloc'd, initialized and freed inside loop. lockFocus and unlockFocus outside loop.
  18.  
  19. Case 4: Same as Case 3 except that user path is cached via ucache.
  20.  
  21. Results
  22. # lines    case1    case 2    case 3    case 4
  23. 5         3.57        2.95        2.41        2.19    
  24. 10        4.46        3.85        2.64        2.37    
  25. 20        6.99        6.39        3.13        2.70
  26. 40        11.34    9.99        4.09        3.36
  27.  
  28. Note: In all cases timing includes time required to do erase, flushwindow and ping window server inside loop.
  29.  
  30. QA388
  31.  
  32. Valid for 1.0 
  33. Not checked yet for 2.0 
  34.  
  35.  
  36.